 /* Estilos existentes (no modificados) */
 body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #e9ecef;
    text-align: center;
    margin: 0;
  }

  h1 {
    color: #343a40;
  }

  #container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
  }

  @media (max-width: 1024px) {
    #container {
      flex-direction: column;
    }
  }

  table {
    margin: 20px;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  }

  td {
    width: 40px;
    height: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
  }

  td.selected {
    background-color: #ffc107;
  }

  td.found {
    background-color: #28a745;
    color: white;
    border: 2px solid #dc3545;
  }

  #word-list {
    margin-left: 20px;
    text-align: left;
  }

  #word-list h3 {
    color: #343a40;
  }

  #word-list ul {
    padding-left: 0;
  }

  #word-list li {
    list-style: none;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #343a40;
  }

  #word-list li.found {
    color: #dc3545;
    text-decoration: line-through;
  }

  #instructions {
    margin-bottom: 20px;
    color: #343a40;
  }

  #create-container input {
    padding: 10px;
    font-size: 16px;
    width: 250px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    margin-right: 10px;
  }

  #create-container button {
    padding: 10px 20px;
    font-size: 16px;
    margin-left: 0px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
  }

  #create-container button:hover {
    background-color: #0056b3;
  }

  #generate-new-btn,
  #check-word-btn,
  #print-btn {
    display: none;
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #28a745;
    color: white;
    margin-right: 10px;
  }

  #generate-new-btn:hover,
  #check-word-btn:hover,
  #print-btn:hover {
    background-color: #218838;
  }

  #message {
    margin-top: 20px;
    font-size: 20px;
    color: #28a745;
    font-weight: bold;
  }

  footer {
    margin-top: 40px;
    color: #6c757d;
  }

  /* Estilos de la modal personalizada */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
  }

  .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
  }

  .modal-content p {
    font-size: 18px;
    color: #333;
  }

  .close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }

  .close-button:hover,
  .close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
  }

  .modal-button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    margin-top: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  .modal-button:hover {
    background-color: #0056b3;
  }

  /* Estilos para impresión */
  @media print {
    .no-print {
      display: none !important;
    }
    #sopa-letras, #word-list {
      display: block;
    }
    #sopa-letras {
      margin: 0 auto;
    }
    #sopa-letras td {
      border: 1px solid #000;
      background-color: #fff !important;
      color: #000 !important;
    }
    #sopa-letras td.found {
      background-color: #ccc !important;
    }
    #word-list {
      margin: 20px auto;
      width: fit-content;
    }
    #word-list h3 {
      margin-top: 0;
    }
    #word-list li {
      color: #000 !important;
      text-decoration: none !important;
    }
    #word-list li.found {
      text-decoration: line-through !important;
    }
  }